package models

import "gorm.io/gorm"

//users 用户表

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(30)"`
	Password string `gorm:"type:varchar(32)"`
}

//user_roles 用户与角色关联表

type UserRole struct {
	gorm.Model
	Uid int `gorm:"type:int"`
	Rid int `gorm:"type:int"`
}

//roles 角色表

type Role struct {
	gorm.Model
	RoleName string `gorm:"type:varchar(30)"`
}

//role_nodes 角色与权限关联表

type RoleNode struct {
	gorm.Model
	Rid int `gorm:"type:int"`
	Nid int `gorm:"type:int"`
}

//nodes 权限表

type Node struct {
	gorm.Model
	NodeName string `gorm:"type:varchar(30)"`
}
